//
//  YTCamerSetCell.m
//  YUNT
//
//  Created by 小萌 on 2017/11/12.
//  Copyright © 2017年 梁炜东. All rights reserved.
//

#import "YTCamerSetCell.h"

@interface YTCamerSetCell()
@property (weak, nonatomic) IBOutlet UIImageView *ivIcon;
@property (weak, nonatomic) IBOutlet UILabel *lbName;
@end


@implementation YTCamerSetCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)cofigWithModel:(YTSetModel*)model
{
    if (self.row == 2) {
        [self reloadWhiteModel:model];
    }else if (self.row == 3){
        [self reloadFlashModel:model];
    }
    self.lbName.text = model.name;
    self.ivIcon.image = IMAGE(model.logo);
}
#pragma mark -重置闪光灯
-(void)reloadFlashModel:(YTSetModel *)model
{
    if ([YTCameraManager shareModel].captureTorchMode == AVCaptureTorchModeOn) {
        model.logo = @"45";
    }else if ([YTCameraManager shareModel].captureFlashMode  == AVCaptureFlashModeOff) {
        model.logo = @"34";
    }else if ([YTCameraManager shareModel].captureFlashMode  == AVCaptureFlashModeOn) {
        model.logo = @"43";
    }else if ([YTCameraManager shareModel].captureFlashMode  == AVCaptureFlashModeAuto) {
        model.logo = @"44";
    }
}
#pragma mark -重置白平衡
-(void)reloadWhiteModel:(YTSetModel *)model
{
    if (publicModel.whiteBalance == 0) {
        model.logo = @"73";
    }else if (publicModel.whiteBalance == 1) {
        model.logo = @"76";
    }else if (publicModel.whiteBalance == 2) {
        model.logo = @"77";
    }else if (publicModel.whiteBalance == 3) {
        model.logo = @"74";
    }else if (publicModel.whiteBalance == 4){
        model.logo = @"75";
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
